package com.hutianao.gqgl.information.cementProduction.service.impl;

import com.hutianao.gqgl.information.cementProduction.entity.SearchCementProductionEntity;
import com.hutianao.gqgl.information.cementProduction.respository.CementProductionDao;
import com.hutianao.gqgl.information.cementProduction.service.CementProductionService;
import com.hutianao.gqgl.mybatis.entity.CementProductionEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PaddingEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PadingRstType;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class CementProductionServiceImpl implements CementProductionService {
    @Resource
    private CementProductionDao cementProductionDao;

    @Override
    public PadingRstType<CementProductionEntity> queryCementProductionInfoListByPage(SearchCementProductionEntity search, PaddingEntity padding) {
        padding.deal(CementProductionEntity.class);
        PadingRstType<CementProductionEntity> padingRstType = new PadingRstType<>();
        padingRstType.setPage(padding.getPage());
        List<CementProductionEntity> list = cementProductionDao.queryCementProductionInfoListByPage(search,padding);
        padingRstType.setRawRecords(list);
        Integer total = cementProductionDao.queryCementProductionInfoTotal(search);
        padingRstType.setTotal(total);
        padingRstType.putItems();

        return padingRstType;
    }
}
